<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>求10的阶乘</title>
</head>

<body>
    <script>
        var total = 1
        var n = 10
        while (n >= 1) {
           total *= n
           n--
        }
        console.log(total)
    </script>
</body>

</html>